


#include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;

class Solution
{
    vector<int> path;
    vector<vector<int>> res;
public:
    vector<vector<int>> findSubsequences(vector<int>& nums)
    {
        _findSubsequences(nums, 0);

        return res;
    }

    int climbStairs1(int n)
    {
        vector<int> dp(n + 1, 1);

        for (int i = 2; i <= n; ++i)
        {
            dp[i] = dp[i - 1] + dp[i - 2];
        }

        return dp[n];
    }

    int climbStairs2(int n)
    {
        int a = 1, b = 1, c = 1;

        for (int i = 2; i <= n; ++i)
        {
            c = a + b;
            a = b;
            b = c;
        }

        return c;
    }

private:
    void _findSubsequences(const vector<int>& nums, int index)
    {
        if (path.size() > 1)
            res.push_back(path);
        if (nums.size() == index)
            return;

        unordered_set<int> used;
        for (int i = index; i < nums.size(); ++i)
        {
            if ((path.size() && nums[i] < path.back()) || used.count(nums[i]))
                continue;

            used.insert(nums[i]);
            path.push_back(nums[i]);
            _findSubsequences(nums, i + 1);
            path.pop_back();
        }
    }
};

int main()
{

	return 0;
}